package com.zbf.auth.auth;

import com.zbf.auth.user.Menu;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * 作者: LCG
 * 日期: 2020/6/9 10:31
 * 描述:
 */
public interface TestMenuDao extends JpaRepository<Menu,Long> {


    @Query(value = "select * from base_menu where leval=1",nativeQuery = true)
    public List<Menu> getFirstMenu();

    @Query(value = "select * from base_menu where leval= :leval and parentCode=:parentCode",nativeQuery = true)
    public List<Menu> getNextMenu(@Param("parentCode") String parentCode,@Param("leval") int leval);

}
